cmake_minimum_required(VERSION 3.6 FATAL_ERROR)

project(demo LANGUAGES CXX)
message("--->CMAKE_CURRENT_SOURCE_DIR" ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(gflags  REQUIRED)
if(NOT gflags_FOUND)
  message(STATUS "NOt Found gflags")
endif()
  message(STATUS "Found gflags: ${_loc} (found version ${gflags_VERSION})")

find_package(glog 0.4.0 CONFIG REQUIRED)
if(NOT glog_FOUND)
  message(STATUS "NOt Found glog")
endif()
get_property(_loc TARGET glog::glog PROPERTY LOCATION)
  message(STATUS "Found glog: ${_loc} (found version ${glog_VERSION})")

add_executable(demo main.cpp )

target_link_libraries(demo
  PUBLIC
    ${gflags_LIBRARIES}
    glog::glog
  )

install(TARGETS demo
  ARCHIVE   DESTINATION lib
  LIBRARY   DESTINATION lib
  RUNTIME   DESTINATION bin
  PUBLIC_HEADER   DESTINATION include
  RESOURCE   DESTINATION resource
 )